// index.js
// 获取应用实例
const app = getApp()
Page({
  data: {

  },
  login() {
    var that = this;
    wx.getUserProfile({
      desc: 'desc',
      success: (res) => {
        wx.login({
          success(res) {
            //发起网络请求
            var code = res.code
            wx.request({
              url: 'http://www.week.com/api/login/dologin', //仅为示例，并非真实的接口地址
              data: {
                code: code
              },
              header: {
                'content-type': 'application/x-www-form-urlencoded'
              },
              success(result) {
                console.log(result.data)
              }
            })
          }

        })
      }
    })
  },
  // 事件处理函数
  bindViewTap() {

  },
  onLoad() {

  },
  getUserProfile(e) {

  },
  getUserInfo(e) {

  }
})